$('.details_banner').mouseover(function(e){
    $('.enlarge').show();
    $('.enlarge_picture').show();
})
$('.details_banner').mouseout(function(){
    $('.enlarge').hide();
    $('.enlarge_picture').hide();
})
$('.details_banner').mousemove(function(e){
    var x = e.pageX - $(this).offset().left-105;
    var y = e.pageY - $(this).offset().top-105;
    $('.enlarge').css({
        left:x+'px',
        top:y+'px'
    })
    $('.enlarge_picture>img').css({
        left:-x*2+'px',
        top:-y*2+'px'
    })
    if(x <= 0) {
    $('.enlarge').css(
        'left','0'
    );
    }
    if(x > 420/2) {
        $('.enlarge').css(
            'left','210px'
        );
    }
    if(y <= 0) {
        $('.enlarge').css(
            'top','0'
        );
    }
    if(y > 420/2) {
        $('.enlarge').css(
            'top','210px'
        );
    }
})
var index = 1;
$('.minus').click(function(){
    index--;
    if(index <= 0) {
        index = 0;
    }
    $('.new_price').html('￥'+178*index+'.00')
    $('.numder').html(index);
})
$('.plus').click(function(){
    index++;
    if(index >= 10) {
        index = 10;
    }
    $('.new_price').html('￥'+178*index+'.00')
    $('.numder').html(index);
})

var arr = ['../images/product_details_img/liquid.jpg','../images/product_details_img/liquid_foundation.jpg','../images/product_details_img/4dbcadatu.jpg','../images/product_details_img/da1dddatu.jpg'];
$('.small_picture').click(function(){
    $('.switch').attr('src',arr[$(this).index()]);
    $('.enlarges').attr('src',arr[$(this).index()]);
})
